#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
    long long n;
    cin >> n;
    n /= 1000;
    n %= (60 * 60 * 24);
    int hour = n / (60 * 60);
    n %= (60 * 60);
    int minute = n / (60);
    n %= (60);
    int second = n;
    printf("%02d:%02d:%02d", hour, minute, second);
    return 0;
}
